<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="170px">
      <el-form-item label="外键，电子档案工程表" prop="eeid">
        <el-input
          v-model="queryParams.eeid"
          placeholder="请输入外键，电子档案工程表"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="案卷名，数字化部输入" prop="anJuanName">
        <el-input
          v-model="queryParams.anJuanName"
          placeholder="请输入案卷名，数字化部输入"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件目录，文件存入服务器自动生成" prop="fileDirectory">
        <el-input
          v-model="queryParams.fileDirectory"
          placeholder="请输入文件目录，文件存入服务器自动生成"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="creationTime">
        <el-date-picker clearable
          v-model="queryParams.creationTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="盒号" prop="henum">
        <el-input
          v-model="queryParams.henum"
          placeholder="请输入盒号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件题名" prop="tname">
        <el-input
          v-model="queryParams.tname"
          placeholder="请输入文件题名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="编制单位" prop="buildorganization">
        <el-input
          v-model="queryParams.buildorganization"
          placeholder="请输入编制单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="数量/单位" prop="amount">
        <el-input
          v-model="queryParams.amount"
          placeholder="请输入数量/单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="纸张规格" prop="spec">
        <el-input
          v-model="queryParams.spec"
          placeholder="请输入纸张规格"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件开始时间" prop="filestart">
        <el-date-picker clearable
          v-model="queryParams.filestart"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择文件开始时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="结束时间" prop="fileend">
        <el-date-picker clearable
          v-model="queryParams.fileend"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择结束时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="保存期限" prop="savetime">
        <el-input
          v-model="queryParams.savetime"
          placeholder="请输入保存期限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="级别" prop="securitylayer">
        <el-input
          v-model="queryParams.securitylayer"
          placeholder="请输入级别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="主题词" prop="thematic">
        <el-input
          v-model="queryParams.thematic"
          placeholder="请输入主题词"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="附注" prop="annotations">
        <el-input
          v-model="queryParams.annotations"
          placeholder="请输入附注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总页数" prop="totalpage">
        <el-input
          v-model="queryParams.totalpage"
          placeholder="请输入总页数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文字页数" prop="txtpage">
        <el-input
          v-model="queryParams.txtpage"
          placeholder="请输入文字页数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建人" prop="cmen">
        <el-input
          v-model="queryParams.cmen"
          placeholder="请输入创建人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="ctime">
        <el-date-picker clearable
          v-model="queryParams.ctime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="校对人" prop="assessor">
        <el-input
          v-model="queryParams.assessor"
          placeholder="请输入校对人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="校对时间" prop="atime">
        <el-date-picker clearable
          v-model="queryParams.atime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择校对时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="案卷分类" prop="topnode">
        <el-input
          v-model="queryParams.topnode"
          placeholder="请输入案卷分类"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="立卷人" prop="injectionperson">
        <el-input
          v-model="queryParams.injectionperson"
          placeholder="请输入立卷人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="立卷时间" prop="injectiondate">
        <el-date-picker clearable
          v-model="queryParams.injectiondate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择立卷时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="审核人" prop="checkperson">
        <el-input
          v-model="queryParams.checkperson"
          placeholder="请输入审核人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="审核时间" prop="checkdate">
        <el-date-picker clearable
          v-model="queryParams.checkdate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择审核时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="工程id" prop="regprojid">
        <el-input
          v-model="queryParams.regprojid"
          placeholder="请输入工程id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电子档案保存路径" prop="path">
        <el-input
          v-model="queryParams.path"
          placeholder="请输入电子档案保存路径"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实体档案存放位置" prop="storeposition">
        <el-input
          v-model="queryParams.storeposition"
          placeholder="请输入实体档案存放位置"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="volumeYuliu1">
        <el-input
          v-model="queryParams.volumeYuliu1"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="volumeYuliu2">
        <el-input
          v-model="queryParams.volumeYuliu2"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="volumeYuliu3">
        <el-input
          v-model="queryParams.volumeYuliu3"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="volumeYuliu4">
        <el-input
          v-model="queryParams.volumeYuliu4"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="检查标志" prop="checkupflag">
        <el-input
          v-model="queryParams.checkupflag"
          placeholder="请输入检查标志"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="拆卷标志" prop="openflag">
        <el-input
          v-model="queryParams.openflag"
          placeholder="请输入拆卷标志"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="完成标志" prop="finishflag">
        <el-input
          v-model="queryParams.finishflag"
          placeholder="请输入完成标志"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="案卷流水号" prop="anjuanLiushui">
        <el-input
          v-model="queryParams.anjuanLiushui"
          placeholder="请输入案卷流水号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="档案盒流水号" prop="boxLiushui">
        <el-input
          v-model="queryParams.boxLiushui"
          placeholder="请输入档案盒流水号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:afanjuan:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:afanjuan:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:afanjuan:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:afanjuan:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="afanjuanList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键,自动生成" align="center" prop="id" />
      <el-table-column label="外键，电子档案工程表" align="center" prop="eeid" />
      <el-table-column label="案卷名，数字化部输入" align="center" prop="anJuanName" />
      <el-table-column label="文件目录，文件存入服务器自动生成" align="center" prop="fileDirectory" />
      <el-table-column label="创建时间" align="center" prop="creationTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.creationTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="盒号" align="center" prop="henum" />
      <el-table-column label="案卷类型" align="center" prop="vtype" />
      <el-table-column label="文件题名" align="center" prop="tname" />
      <el-table-column label="编制单位" align="center" prop="buildorganization" />
      <el-table-column label="数量/单位" align="center" prop="amount" />
      <el-table-column label="纸张规格" align="center" prop="spec" />
      <el-table-column label="文件开始时间" align="center" prop="filestart" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.filestart, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结束时间" align="center" prop="fileend" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.fileend, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="保存期限" align="center" prop="savetime" />
      <el-table-column label="级别" align="center" prop="securitylayer" />
      <el-table-column label="主题词" align="center" prop="thematic" />
      <el-table-column label="附注" align="center" prop="annotations" />
      <el-table-column label="文件总数" align="center" prop="totalfile" />
      <el-table-column label="总页数" align="center" prop="totalpage" />
      <el-table-column label="文字页数" align="center" prop="txtpage" />
      <el-table-column label="创建人" align="center" prop="cmen" />
      <el-table-column label="创建时间" align="center" prop="ctime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.ctime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="校对人" align="center" prop="assessor" />
      <el-table-column label="校对时间" align="center" prop="atime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.atime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="content" />
      <el-table-column label="案卷分类" align="center" prop="topnode" />
      <el-table-column label="立卷人" align="center" prop="injectionperson" />
      <el-table-column label="立卷时间" align="center" prop="injectiondate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.injectiondate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审核人" align="center" prop="checkperson" />
      <el-table-column label="审核时间" align="center" prop="checkdate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.checkdate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="工程id" align="center" prop="regprojid" />
      <el-table-column label="电子档案保存路径" align="center" prop="path" />
      <el-table-column label="实体档案存放位置" align="center" prop="storeposition" />
      <el-table-column label="${comment}" align="center" prop="volumeYuliu1" />
      <el-table-column label="${comment}" align="center" prop="volumeYuliu2" />
      <el-table-column label="${comment}" align="center" prop="volumeYuliu3" />
      <el-table-column label="${comment}" align="center" prop="volumeYuliu4" />
      <el-table-column label="检查标志" align="center" prop="checkupflag" />
      <el-table-column label="拆卷标志" align="center" prop="openflag" />
      <el-table-column label="完成标志" align="center" prop="finishflag" />
      <el-table-column label="案卷流水号" align="center" prop="anjuanLiushui" />
      <el-table-column label="档案盒流水号" align="center" prop="boxLiushui" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:afanjuan:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:afanjuan:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改案卷管理审核后对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="外键，电子档案工程表" prop="eeid">
          <el-input v-model="form.eeid" placeholder="请输入外键，电子档案工程表" />
        </el-form-item>
        <el-form-item label="案卷名，数字化部输入" prop="anJuanName">
          <el-input v-model="form.anJuanName" placeholder="请输入案卷名，数字化部输入" />
        </el-form-item>
        <el-form-item label="文件目录，文件存入服务器自动生成" prop="fileDirectory">
          <el-input v-model="form.fileDirectory" placeholder="请输入文件目录，文件存入服务器自动生成" />
        </el-form-item>
        <el-form-item label="创建时间" prop="creationTime">
          <el-date-picker clearable
            v-model="form.creationTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择创建时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="盒号" prop="henum">
          <el-input v-model="form.henum" placeholder="请输入盒号" />
        </el-form-item>
        <el-form-item label="文件题名" prop="tname">
          <el-input v-model="form.tname" placeholder="请输入文件题名" />
        </el-form-item>
        <el-form-item label="编制单位" prop="buildorganization">
          <el-input v-model="form.buildorganization" placeholder="请输入编制单位" />
        </el-form-item>
        <el-form-item label="数量/单位" prop="amount">
          <el-input v-model="form.amount" placeholder="请输入数量/单位" />
        </el-form-item>
        <el-form-item label="纸张规格" prop="spec">
          <el-input v-model="form.spec" placeholder="请输入纸张规格" />
        </el-form-item>
        <el-form-item label="文件开始时间" prop="filestart">
          <el-date-picker clearable
            v-model="form.filestart"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择文件开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束时间" prop="fileend">
          <el-date-picker clearable
            v-model="form.fileend"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="保存期限" prop="savetime">
          <el-input v-model="form.savetime" placeholder="请输入保存期限" />
        </el-form-item>
        <el-form-item label="级别" prop="securitylayer">
          <el-input v-model="form.securitylayer" placeholder="请输入级别" />
        </el-form-item>
        <el-form-item label="主题词" prop="thematic">
          <el-input v-model="form.thematic" placeholder="请输入主题词" />
        </el-form-item>
        <el-form-item label="附注" prop="annotations">
          <el-input v-model="form.annotations" placeholder="请输入附注" />
        </el-form-item>
        <el-form-item label="文件总数" prop="totalfile">
          <file-upload v-model="form.totalfile"/>
        </el-form-item>
        <el-form-item label="总页数" prop="totalpage">
          <el-input v-model="form.totalpage" placeholder="请输入总页数" />
        </el-form-item>
        <el-form-item label="文字页数" prop="txtpage">
          <el-input v-model="form.txtpage" placeholder="请输入文字页数" />
        </el-form-item>
        <el-form-item label="创建人" prop="cmen">
          <el-input v-model="form.cmen" placeholder="请输入创建人" />
        </el-form-item>
        <el-form-item label="创建时间" prop="ctime">
          <el-date-picker clearable
            v-model="form.ctime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择创建时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="校对人" prop="assessor">
          <el-input v-model="form.assessor" placeholder="请输入校对人" />
        </el-form-item>
        <el-form-item label="校对时间" prop="atime">
          <el-date-picker clearable
            v-model="form.atime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择校对时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注">
          <editor v-model="form.content" :min-height="192"/>
        </el-form-item>
        <el-form-item label="案卷分类" prop="topnode">
          <el-input v-model="form.topnode" placeholder="请输入案卷分类" />
        </el-form-item>
        <el-form-item label="立卷人" prop="injectionperson">
          <el-input v-model="form.injectionperson" placeholder="请输入立卷人" />
        </el-form-item>
        <el-form-item label="立卷时间" prop="injectiondate">
          <el-date-picker clearable
            v-model="form.injectiondate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择立卷时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="审核人" prop="checkperson">
          <el-input v-model="form.checkperson" placeholder="请输入审核人" />
        </el-form-item>
        <el-form-item label="审核时间" prop="checkdate">
          <el-date-picker clearable
            v-model="form.checkdate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择审核时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="工程id" prop="regprojid">
          <el-input v-model="form.regprojid" placeholder="请输入工程id" />
        </el-form-item>
        <el-form-item label="电子档案保存路径" prop="path">
          <el-input v-model="form.path" placeholder="请输入电子档案保存路径" />
        </el-form-item>
        <el-form-item label="实体档案存放位置" prop="storeposition">
          <el-input v-model="form.storeposition" placeholder="请输入实体档案存放位置" />
        </el-form-item>
        <el-form-item label="${comment}" prop="volumeYuliu1">
          <el-input v-model="form.volumeYuliu1" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="volumeYuliu2">
          <el-input v-model="form.volumeYuliu2" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="volumeYuliu3">
          <el-input v-model="form.volumeYuliu3" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="${comment}" prop="volumeYuliu4">
          <el-input v-model="form.volumeYuliu4" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="检查标志" prop="checkupflag">
          <el-input v-model="form.checkupflag" placeholder="请输入检查标志" />
        </el-form-item>
        <el-form-item label="拆卷标志" prop="openflag">
          <el-input v-model="form.openflag" placeholder="请输入拆卷标志" />
        </el-form-item>
        <el-form-item label="完成标志" prop="finishflag">
          <el-input v-model="form.finishflag" placeholder="请输入完成标志" />
        </el-form-item>
        <el-form-item label="案卷流水号" prop="anjuanLiushui">
          <el-input v-model="form.anjuanLiushui" placeholder="请输入案卷流水号" />
        </el-form-item>
        <el-form-item label="档案盒流水号" prop="boxLiushui">
          <el-input v-model="form.boxLiushui" placeholder="请输入档案盒流水号" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listAfanjuan, getAfanjuan, delAfanjuan, addAfanjuan, updateAfanjuan } from "@/api/system/afanjuan";

export default {
  name: "Afanjuan",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 案卷管理审核后表格数据
      afanjuanList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        eeid: null,
        anJuanName: null,
        fileDirectory: null,
        creationTime: null,
        henum: null,
        vtype: null,
        tname: null,
        buildorganization: null,
        amount: null,
        spec: null,
        filestart: null,
        fileend: null,
        savetime: null,
        securitylayer: null,
        thematic: null,
        annotations: null,
        totalfile: null,
        totalpage: null,
        txtpage: null,
        cmen: null,
        ctime: null,
        assessor: null,
        atime: null,
        content: null,
        topnode: null,
        injectionperson: null,
        injectiondate: null,
        checkperson: null,
        checkdate: null,
        regprojid: null,
        path: null,
        storeposition: null,
        volumeYuliu1: null,
        volumeYuliu2: null,
        volumeYuliu3: null,
        volumeYuliu4: null,
        checkupflag: null,
        openflag: null,
        finishflag: null,
        anjuanLiushui: null,
        boxLiushui: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        eeid: [
          { required: true, message: "外键，电子档案工程表不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询案卷管理审核后列表 */
    getList() {
      this.loading = true;
      listAfanjuan(this.queryParams).then(response => {
        this.afanjuanList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        eeid: null,
        anJuanName: null,
        fileDirectory: null,
        creationTime: null,
        henum: null,
        vtype: null,
        tname: null,
        buildorganization: null,
        amount: null,
        spec: null,
        filestart: null,
        fileend: null,
        savetime: null,
        securitylayer: null,
        thematic: null,
        annotations: null,
        totalfile: null,
        totalpage: null,
        txtpage: null,
        cmen: null,
        ctime: null,
        assessor: null,
        atime: null,
        content: null,
        topnode: null,
        injectionperson: null,
        injectiondate: null,
        checkperson: null,
        checkdate: null,
        regprojid: null,
        path: null,
        storeposition: null,
        volumeYuliu1: null,
        volumeYuliu2: null,
        volumeYuliu3: null,
        volumeYuliu4: null,
        checkupflag: null,
        openflag: null,
        finishflag: null,
        anjuanLiushui: null,
        boxLiushui: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加案卷管理审核后";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getAfanjuan(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改案卷管理审核后";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateAfanjuan(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addAfanjuan(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除案卷管理审核后编号为"' + ids + '"的数据项？').then(function() {
        return delAfanjuan(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/afanjuan/export', {
        ...this.queryParams
      }, `afanjuan_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
